import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter_member/bottom_navigation/botton_navigation_widget.dart';
import 'package:flutter_member/logon_status.dart';
import 'package:flutter_member/pages/course/course_detail/curriculum_details.dart';
import 'package:flutter_member/pages/index/index.dart';
import 'package:flutter_member/pages/index/subpage/attendance_record_page.dart';
import 'package:flutter_member/pages/index/subpage/diet_page.dart';
import 'package:flutter_member/pages/index/subpage/growth_record_page.dart';
import 'package:flutter_member/pages/index/subpage/order_record_page.dart';
import 'package:flutter_member/pages/index/subpage/parent_list.dart';
import 'package:flutter_member/pages/index/subpage/student_info_page.dart';
import 'package:flutter_member/pages/index/subpage/student_photo_album_page.dart';
import 'package:flutter_member/pages/index/subpage/subscription_service_page.dart';
import 'package:flutter_member/pages/login/login_page.dart';
import 'package:flutter_member/pages/personal_center/balance_page.dart';
import 'package:flutter_member/pages/personal_center/course/my_course.dart';
import 'package:flutter_member/pages/personal_center/im/contact_im.dart';
import 'package:flutter_member/pages/personal_center/im/customer_service_list.dart';
import 'package:flutter_member/pages/personal_center/membership_page.dart';
import 'package:flutter_member/pages/personal_center/settings.dart';
import 'package:flutter_member/pages/scholar/sign_tutoria.dart';
import 'package:flutter_member/pages/school_network/details/campus_network_details.dart';
//import 'package:my_fluro_demo/pages/index_page.dart'
/* *
 * handler就是每个路由的规则，编写handler就是配置路由规则，
 * 比如我们要传递参数，参数的值是什么，这些都需要在Handler中完成。
 */

// 首页
Handler indexPageHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return BottomNavigationWidget();
  },
);
// 闪屏
Handler logonStatusHandler = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return LogonStatus();
  },
);

// 登陆页面
Handler loginHanderl = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return LoginPage();
    }
);

//餘額
var balanceHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return BalancePage();
    });

///會員積分頁面
var membershippageHandler = Handler(
    handlerFunc: (BuildContext context,Map<String,List<String>>params){
      return MemberShipPage();
    }
);

/*---------------------首页的那几个页面跳转start---------------------*/
///学生相册
var studentAlbumHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return StudentPhotoAlbumPage();
    });

///学生信息
var informationHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return StudentInfoPage();
    });
/// 成长记录
var growUpHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return GrowthRecordPage();
    });
/// 订阅服务
var serviceHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return SubscriptionServicePage();
    });
/// 出勤记录
var attendanceRecordHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return AttendanceRecordPage();
    });
//// 膳食
var dietHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return DietPage();
    });
////家长列表
var parentsHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return ParentList();
    });
///d订单记录
var orderHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return OrderRecordPage();
    });
//  補習登記
var signTutoriaHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      var id = params['id'];
      return SignTutoria(
        objectId: id,
      );
    });
/*---------------------首页的那几个页面跳转end---------------------*/

/*---------------------抽屉部分START----------------------------------*/
/// 設置頁面
var settingsHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return SettingsPage();
    });

///客服列表
var contactUsHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return CustomerServiceList();
    });

// 聊天界面
var personalIm = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return ImPage();
    });

//我的課程
var myCourseHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return MyCourse();
    });

/*---------------------抽屉部分END----------------------------------*/
/*---------------------课程START----------------------------------*/

/*---------------------课程END----------------------------------*/
var curriculumDetailsHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      var id = params["id"]?.first;
      return CurriculumDetailsPage(
        id: id,
      );
    });
/*---------------------分校网络相关START------------------------------*/
/// 分校详情
var campusNetworkDetailsPageHandler = Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      var id = params["objectId"];
      return CampusNetworkDetailsPage(
        objectId: id,
      );
    });
/*---------------------分校网络相关END-------------------------------*/